package cn.blnp.net.flowable.boot.optimize.idgen;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.impl.cmd.LockCmd;
import org.flowable.common.engine.impl.cmd.ReleaseLockCmd;
import org.flowable.common.engine.impl.persistence.StrongUuidGenerator;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.impl.cmd.GetNextIdBlockCmd;
import org.flowable.engine.impl.db.DbIdGenerator;
import org.flowable.engine.impl.history.DefaultHistoryManager;
import org.flowable.engine.impl.history.async.AsyncHistoryManager;
import org.flowable.engine.impl.history.async.json.transformer.ActivityStartHistoryJsonTransformer;
import org.flowable.job.service.impl.JobServiceImpl;
import org.flowable.job.service.impl.asyncexecutor.AsyncExecutor;
import org.flowable.job.service.impl.asyncexecutor.DefaultAsyncJobExecutor;
import org.flowable.job.service.impl.cmd.AcquireTimerJobsCmd;
import org.flowable.job.service.impl.cmd.AcquireTimerJobsWithGlobalAcquireLockCmd;
import org.flowable.job.service.impl.cmd.BulkMoveTimerJobsToExecutableJobsCmd;
import org.flowable.job.service.impl.history.async.AsyncHistoryJobHandler;
import org.flowable.job.service.impl.history.async.DefaultAsyncHistoryJobProducer;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;

/**
 * <h3>自定义 ID生成器测试</h3>
 *
 * @author <a href="mailto:blnp.yibin@qq.com">lyb</a>
 * @version 1.0
 * @since 2025/6/23 13:46
 */
@Slf4j
@SpringBootTest
public class CusIdGenTest {

    @Resource
    private RepositoryService repositoryService;

    @Test
    public void test() {
        Snowflake snowflake = IdUtil.getSnowflake(1, 1);
        for (int i = 0; i < 20; i++) {
            log.info("{}", snowflake.nextId());
        }
    }
}
